<?php

namespace app\crontab\model;

use think\Model;

class Order extends Model
{
    protected $type = [
        'pay_info'    =>  'json',
        'address'   => 'json',
        'commission_info' => 'json',
    ];

    public static function orderList($where,$field="o.*,p.commission_price"){
        return self::alias("o")
            ->leftJoin("product p","p.id=o.p_id")
            ->leftJoin("user u","u.uid=o.uid")
            ->where($where)
            ->field($field)
            ->group("o.id")
            ->select();
    }
}